package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {

    /**
     * 新增口味u
     * @param dishFlavor
     */
    void insertDishFlavor(DishFlavor dishFlavor) ;

    /**
     * 根据dishId删除flavor_dish表中的数据
     * @param dishId
     */
    @Delete("delete from dish_flavor where dish_id=#{dishId} ")
    void deleteByDishId(Long dishId);


    /**
     *
     * 根据dish_id集合批量删除删除flavor_dish表中的数据
     * @param dishIds
     */
    void deleteByDishIds(List<Long> dishIds);

    /**
     * 根据id查询口味
     * @param dishId
     * @return
     */
    @Select("select * from dish_flavor where dish_id=#{dishId}")
    List<DishFlavor> select(Long dishId);
}
